-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support topic-level max message size #8732
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
sijie
approved these changes
Nov 30, 2020
sijie
added
the
doc-required
Your PR changes impact docs and you will update later.
label
Nov 30, 2020
codelipenghui
approved these changes
Nov 30, 2020
/pulsarbot cherry-pick to branch-2.7 |
github-actions bot
pushed a commit
that referenced
this pull request
Nov 30, 2020
fix https://github.com/streamnative/pulsar/issues/1723 ### Motivation The current policy to control the size of the message is at the broker level(maxMessageSize). It becomes easier to plan resource quotas for client allocation if the max message size pushed can be given at the topic level. ### Modifications Now the broker-level `maxMessageSize` is returned by the broker to the client, when the broker handles `handleConnected`. The client will cached `maxMessageSize` locally. An exception will be thrown if it exceeds the limit. Topic-level cannot be implemented like this, because: 1) When `handleConnected`, the command received by the broker does not contain specific topic information, so it is not known which topic policy to return to the client. 2) The client cannot cache topic-level policy. Unlike the broker-level policy, which will not change, the topic-level policy will change dynamically, which will involve cache consistency issues. I think the best way to handle this is to let the broker determine whether it exceeds the limit, and return an exception if it exceeds the limit, and handle the exception by the client's `handleSendError`. ### Verifying this change TopicPoliciesTest.java (cherry picked from commit 9c28378)
codelipenghui
added a commit
that referenced
this pull request
Dec 2, 2020
fix https://github.com/streamnative/pulsar/issues/1723 ### Motivation The current policy to control the size of the message is at the broker level(maxMessageSize). It becomes easier to plan resource quotas for client allocation if the max message size pushed can be given at the topic level. ### Modifications Now the broker-level `maxMessageSize` is returned by the broker to the client, when the broker handles `handleConnected`. The client will cached `maxMessageSize` locally. An exception will be thrown if it exceeds the limit. Topic-level cannot be implemented like this, because: 1) When `handleConnected`, the command received by the broker does not contain specific topic information, so it is not known which topic policy to return to the client. 2) The client cannot cache topic-level policy. Unlike the broker-level policy, which will not change, the topic-level policy will change dynamically, which will involve cache consistency issues. I think the best way to handle this is to let the broker determine whether it exceeds the limit, and return an exception if it exceeds the limit, and handle the exception by the client's `handleSendError`. ### Verifying this change TopicPoliciesTest.java (cherry picked from commit 9c28378) Co-authored-by: feynmanlin <feynmanlin@tencent.com>
Anonymitaet
removed
the
doc-required
Your PR changes impact docs and you will update later.
label
Mar 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix https://github.com/streamnative/pulsar/issues/1723
Motivation
The current policy to control the size of the message is at the broker level(maxMessageSize). It becomes easier to plan resource quotas for client allocation if the max message size pushed can be given at the topic level.
Modifications
Now the broker-level
maxMessageSize
is returned by the broker to the client, when the broker handleshandleConnected
. The client will cachedmaxMessageSize
locally. An exception will be thrown if it exceeds the limit.Topic-level cannot be implemented like this, because:
handleConnected
, the command received by the broker does not contain specific topic information, so it is not known which topic policy to return to the client.I think the best way to handle this is to let the broker determine whether it exceeds the limit, and return an exception if it exceeds the limit, and handle the exception by the client's
handleSendError
.Verifying this change
TopicPoliciesTest.java